import request from '@/utils/request'

export default {
    //1 讲师列表（条件查询分页）
    //current当前页 limit每页记录数 teacherQuery条件对象
    getTeacherListPage(teacherQuery) {
        return request({
            //url: '/eduservice/teacher/pageTeacherCondition/'+current+"/"+limit,
            url: `/edu/teacher/page`,
            method: 'post',
            //teacherQuery条件对象，后端使用RequestBody获取数据
            //data表示把对象转换json进行传递到接口里面
            data: teacherQuery
          })
    },
    deleteTeacherId(id) {
        return request({
            url: `/edu/teacher/${id}`,
            method: 'delete',
          })
    },
    // 新增
    saveTeacher(teacher) {
        return request({
            url: `/edu/teacher/add`,
            method: 'post',
            data:teacher
          })
    },
    //查询通过id
    getTeacherById(id){
        return request({
            url: `/edu/teacher/${id}`,
            method: 'get',
          })
    },
    //修改信息
    updateTeacher(teacher){
        return request({
            url: `/edu/teacher/update`,
            method: 'put',
            data: teacher
            })
    },
    //修改信息
    getImg(){
        return request({
            url: `/edu/captcha/code/image`,
            method: 'get'
            })
    },
}